#include "RTC.h"


// static const char *TAG = "RTC";

void set_time(void)
{
    struct tm datetime;
    datetime.tm_year = 2022 - 1900;
    datetime.tm_mon = 5 - 1;
    datetime.tm_mday = 10;
    datetime.tm_hour = 22;
    datetime.tm_min = 22;
    datetime.tm_sec = 0;
    datetime.tm_isdst = -1;

    time_t second = mktime(&datetime);
    struct timeval val = { .tv_sec = second, .tv_usec = 0 };
    settimeofday(&val, NULL);
}

time_t *get_time(void)
{
    time_t second;
    struct tm *datetime;

    time(&second);
    datetime = localtime(&second);
    return  (time_t *)datetime;
}
